<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<%@ include file="/WEB-INF/views/include/head.jsp"%>
<script type="text/javascript">
	$(document).ready(function() {
		$("#weiXiuForm").validate();
		
		var flag = "${obj.flag}";
		if(flag == 'edit'){
			$("#weiXiuForm").attr("action","${ctx}/WeiXiu/update");
		}
		
		$( "#gouMaiRiQi" ).datepicker({
			 changeMonth:true,      //月选项
			 changeYear: true,      //年选项
			 dateFormat:"yy-mm-dd",   //时间格式
			 showButtonPanel: true, //显示面板底部按钮
		    closeTextType:"关闭", //关闭按钮文字
		     currentText: "今天",   //返回今天按钮文字
		     dayNamesMin:['天','一','二','三','四','五','六'],     //星期   
		     monthNamesShort:['1','2','3','4','5','6','7','8','9','10','11','12']       //月份显示
		});
	});
</script>
</head>
<body class="ContentBody">
	<form action="${ctx}/AnZhuang/save" method="post" id="weiXiuForm" enctype="multipart/form-data">
	<input type="hidden" name="weiXiuId" value="${obj.weixiu.weiXiuId }"/>
	<input type="hidden" name="dingDanHao" value="${obj.weixiu.dingDanHao }"/>
	<input type="hidden" name="luRuRen" value="${obj.weixiu.luRuRen }"/>
	<input type="hidden" name="tuPian1" value="${obj.weixiu.tuPian1 }"/>
	<input type="hidden" name="tuPian2" value="${obj.weixiu.tuPian2 }"/>
	<input type="hidden" name="tuPian3" value="${obj.weixiu.tuPian3 }"/>
	<input name="baoXiuRiQi" id="baoXiuRiQi"  type="hidden" value="<fmt:formatDate value="${obj.weixiu.baoXiuRiQi}" pattern="yyyy-MM-dd"/>"/>
		<tr>
			<td height="30">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td height="62" background="${ctxStatic}/images/nav04.gif">
							<!--  -->
							<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<div class="MainDiv">
			<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
				<tr>
					<th class="tablestyle_title">添加安装单页面</th>
				</tr>
				<tr>
					<td class="CPanel">
				<TR>
					<TD width="100%">
						<fieldset style="height: 100%;">
							<legend>添加安装单</legend>
							<table border="0" cellpadding="2" cellspacing="1" style="width: 100%">
								<tr>
									<td nowrap align="right" width="13%">维修人员:</td>
									<td width="41%">
									<select class="required" name="weiXiuRen" id="weiXiuRen">
									<option value="" >---请选择---</option>
									<c:forEach items="${obj.shiFus}" var="shifu">
									  <option value="${shifu.shiFuName}"  <c:if test="${ obj.weixiu.weiXiuRen == shifu.shiFuName}">selected="selected"</c:if>>${shifu.shiFuName}</option>
									</c:forEach>
									</select>
									</td>
									<td align="right" width="19%">品牌名:</td>
									<td width="27%">
									<select class="required" name="pingPaiHao" id="pingPaiHao">
									<option value="">---请选择---</option>
									<c:forEach items="${obj.pingPais}" var="pingpai">
									  <option value="${pingpai.pingPaiName}" <c:if test="${ obj.weixiu.pingPaiHao == pingpai.pingPaiName}">selected="selected"</c:if> >${pingpai.pingPaiName}</option>
									</c:forEach>
									</select>
									</td>
								</tr>
								<tr>
									<td nowrap align="right" width="13%">用户地址:</td>
									<td width="41%"><input id="yongHuDiZhi" name="yongHuDiZhi" class="text required" type="text"  value="${obj.weixiu.yongHuDiZhi}"/></td>
									<td nowrap align="right" width="13%">品牌型号:</td>
									<td width="27%"><input name="pingPaiXingHao" id="pingPaiXingHao" class="text" type="text"  value="${obj.weixiu.pingPaiXingHao}"/></td>
								</tr>
								<tr>
									<td nowrap align="right" width="13%">用户电话:</td>
									<td width="41%"><input id="yongHuPhone" name="yongHuPhone" class="text required" type="text" value="${obj.weixiu.yongHuPhone}" /></td>
									<td align="right" width="19%">购买日期:</td>
									<td width="27%"><input name="gouMaiRiQi" id="gouMaiRiQi"  readonly="readonly" type="text" value="<fmt:formatDate value="${obj.weixiu.gouMaiRiQi}" pattern="yyyy-MM-dd"/>"/></td>
								</tr>
								<tr>
									<td align="right" width="19%">用户姓名:</td>
									<td width="41%"><input id="yongHuName" name="yongHuName" class="text required" type="text" value="${obj.weixiu.yongHuName}"/></td>
									<td align="right" width="19%">内机条码:</td>
									<td width="27%"><input name="tiaoMa" id="tiaoMa" class="text" type="text" style="width:240px;" value="${obj.weixiu.tiaoMa}"/></td>
								</tr>
								<tr>
									<td nowrap align="right" width="13%">是否安装:</td>
									<td width="41%"><input name="zhuangTai" class="text required" type="radio" value="1"  checked="checked"/>未安装&nbsp;&nbsp;&nbsp;&nbsp;<input
										name="zhuangTai" class="text required" type="radio" value="2" <c:if test="${ obj.weixiu.zhuangTai == 2}">checked="checked"</c:if> />已安装</td>
									<td nowrap align="right" width="13%">外机条码:</td>
									<td width="27%"><input name="waiJiTiaoMa" id="waiJiTiaoMa"   class="text" style="width:240px;"  type="text" value="${obj.weixiu.waiJiTiaoMa}"/></td>
								</tr>
								<tr>
									<td nowrap align="right" width="13%">保修类型:</td>
									<td width="41%"><input name="baoXiuLeiXing" class="text required" type="radio" value="1"  checked="checked"/>保修内&nbsp;&nbsp;&nbsp;&nbsp;<input
										name="baoXiuLeiXing" class="text required" type="radio" value="2" <c:if test="${ obj.weixiu.baoXiuLeiXing == 2}">checked="checked"</c:if> />保修外</td>
									<td nowrap align="right" width="13%">图片1:</td>
									<td width="27%"><input name="file"  type="file" /></td>
								</tr>
								<tr>
									<td nowrap align="right" width="13%">拉修费用:</td>
									<td width="41%"><input id="laXiuFeiYong" name="laXiuFeiYong" class="text number" type="text" /></td>
									<td align="right" width="19%">图片2:</td>
									<td width="27%"><input name="file"   type="file" /></td>
								</tr>
								<tr>
									<td align="right" width="19%">维修费用:</td>
									<td width="41%"><input id="weiXiuFei" name="weiXiuFei" class="text number" type="text" /></td>
									<td align="right" width="19%">图片3:</td>
									<td width="27%"><input name="file"  type="file" /></td>
								</tr>
								<tr>
									<td nowrap align="right" width="13%">故障原因:</td>
									<td width="41%">
									<textarea rows="5" name="guZhangYuanYin" >${obj.weixiu.guZhangYuanYin}</textarea>
									</td>
									<td align="right" width="19%">维修措施:</td>
									<td width="27%">
									<textarea rows="5" name="weiXiuCuoShi" >${obj.weixiu.weiXiuCuoShi}</textarea>
									</td>
								</tr>
								<tr>
									<td colspan="4" align="center"><font color="red" id="mima"></font></td>
								</tr>
							</table>
							<br />
						</fieldset>
					</TD>
				</TR>
				</td>
				</tr>
				<TR>
					<TD colspan="2" align="center" height="50px"><input type="submit" name="Submit" value="保存" class="button" /> <input type="button"
						name="Submit2" value="返回" class="button" onclick="window.history.go(-1);" /></TD>
				</TR>
			</TABLE>
			</td>
			</tr>
			</table>
		</div>
	</form>
</body>
</html>
